package com.blockmeta.bbs.businesslibrary.net.retrofit.api;

import com.blockmeta.bbs.businesslibrary.net.pojo.BaseCodeResponse;
import com.blockmeta.bbs.businesslibrary.net.pojo.GetChatGroupByUserIdResponse;
import com.blockmeta.bbs.businesslibrary.net.pojo.PostResponse;
import com.blockmeta.bbs.businesslibrary.net.pojo.UploadPicResponse;
import com.blockmeta.bbs.businesslibrary.net.request.ForwardApiRequest;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author AirThor
 * @date 2019/7/15.
 */
public class NetApi {
    /**
     * 发帖回帖上传图片
     */
    public interface UpLoadPic {
        /**
         * 上传图片
         *
         * @param requestBody 参数
         * @param token       token
         * @return
         */
        @POST("http://media.8btc.com/post/attach")
        Flowable<BaseCodeResponse<UploadPicResponse>> upLoadPic(@Body RequestBody requestBody, @Header("token") String token);
    }

    /**
     * 对php接口发帖转发的接口
     */
    public interface Post {
        /**
         * 发帖
         */
        @POST("forward")
        Flowable<BaseCodeResponse<PostResponse>> posted(@Body ForwardApiRequest forwardApiRequest);
    }

    /**
     * 获取用户创建的圈子
     */
    public interface ListChatGroupByCreateUserId{
        @GET("im/chatGroup/listChatGroupByCreateUserId")
        Flowable<GetChatGroupByUserIdResponse> listChatGroupByCreateUserId(@Query("user_id") int userId);
    }


}
